﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models
{
    /// <summary>
    /// 亲子任务完成记录
    /// </summary>
    public class ParentChildTasksRecord : BusinessFullEntityBase<Guid>
    {
        /// <summary>
        /// 记录内容
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 发布人称呼
        /// </summary>
        public string? CreateUserName { get; set; }

        /// <summary>
        /// 家属关系
        /// </summary>
        public int? Relationship { get; set; }

        /// <summary>
        /// 关联幼儿Id
        /// </summary>
        public Guid? RelationshipChildrenId { get; set; }

        /// <summary>
        /// 文件id集合
        /// </summary>
        public string? FileIds { get; set; }

        /// <summary>
        /// 亲子任务Id
        /// </summary>
        public Guid ParentChildTasksId { get; set; }

        /// <summary>
        /// 亲子任务信息
        /// </summary>
        public ParentChildTasks? ParentChildTasks;

        /// <summary>
        /// 第几次打卡
        /// </summary>
        public int? HowManyTimes { get; set; }

        /// <summary>
        /// 内容图片
        /// </summary>
        public List<ParentChildTasksRecordImage>? Images = null;

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<ParentChildTasksRecord>(entity =>
            {
                entity.HasOne(c => c.ParentChildTasks).WithMany(c => c.RecodeList).HasForeignKey(c => c.ParentChildTasksId);
            });
        }
    }
}
